<!-- 项目管理 -->
<template>
  <div class="w-full h-full">
    <el-tabs v-model="activeName">
      <el-tab-pane label="实时数据" name="realTime">
        <RealTime :incomeValue="incomeValue" :payValue="payValue" :unitPrice="unitPrice" />
      </el-tab-pane>
      <el-tab-pane label="账单" name="bill">
        <div class="flex-1 flex gap-4">
          <div class="w-1/2"><Income @income-total="income" @unit-price="getUnitPrice" /></div>
          <div class="w-1/2"><Pay @pay-total="pay" /></div>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import Income from './Income.vue'
import Pay from './Pay.vue'
import RealTime from './RealTime.vue'
const activeName = ref('realTime')

const incomeValue = ref(0)
const payValue = ref(0)
const income = (val) => {
  incomeValue.value = val
}

const pay = (val) => {
  payValue.value = val
}

const unitPrice = ref(0)
const getUnitPrice = (val) => {
  unitPrice.value = val
}
</script>

<style lang="scss" scoped></style>
